﻿using System.Web.Mvc;
using Sharp.Portal.Mvc.List;

namespace Sharp.WebBooter.Areas.Platform
{
    public class ViewModelFilter: IResultFilter
    {
        public void OnResultExecuted(ResultExecutedContext filterContext)
        {
        }

        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var viewData = filterContext.Controller.ViewData;

            var sharpList = viewData.Model as SharpList;
            if (sharpList == null) return;


            sharpList.Preference = typeof(UserConfigInfo);
            sharpList.SystemConfig = typeof(PlatformInfo);
        }
    }
}
